package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.dto.AlertDataHandleDto;
import com.zzyl.dto.AlertDataPageQueryDto;
import com.zzyl.mapper.AlertDataMapper;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description AlertDataServiceImpl
 * @Author jun
 * @Date 2025-09-16
 */
@Service
public class AlertDataServiceImpl implements AlertDataService {

    @Autowired
    private AlertDataMapper alertDataMapper;

    @Override
    public PageResponse<AlertDataVo> pageAlertData(AlertDataPageQueryDto alertDataPageQueryDto) {

        PageHelper.startPage(alertDataPageQueryDto.getPageNum() , alertDataPageQueryDto.getPageSize());
        List<AlertDataVo> alertDataVoList = alertDataMapper.pageAlertData(alertDataPageQueryDto);
        Page<AlertDataVo> alertDataVoPage = (Page<AlertDataVo>) alertDataVoList;
        return PageResponse.of(alertDataVoPage , AlertDataVo.class);

    }

    @Override
    public void handleAlertData(AlertDataHandleDto alertDataHandleDto) {
        alertDataMapper.getIdHandleAlertData(alertDataHandleDto);
    }


}
